<template>
  <el-drawer v-model="addDrawer" size="48%" :show-close="false" @opened="openDrawer"
    @close="closeDrawer">
    <template #title>
      <h2><svg-icon icon-class="list"></svg-icon><span style="padding-left: 15px">{{typeName}}</span></h2>
      <el-button type="primary" @click="confirmClick" :disabled="drawerLoading" v-if="isShowSave">保存</el-button>
    </template>
    <template #default>
      <el-form :model="form" ref="addRef" :inline="true" label-width="160px" v-loading="drawerLoading">
        <el-row justify="space-between">
          <el-form-item label="省">
            <el-input v-model="form.province" clearable disabled></el-input>
          </el-form-item>
          <el-form-item label="市">
            <el-input v-model="form.city" clearable disabled></el-input>
          </el-form-item>
        </el-row>
        <el-row justify="space-between">
          <el-form-item label="区/县">
            <el-input v-model="form.county" clearable disabled></el-input>
          </el-form-item>
          <el-form-item label="OBJECTID" prop="objectId">
              <el-input v-model.number="form.objectId" placeholder="请输入OBJECTID" clearable></el-input>
            </el-form-item>
        </el-row>
        <el-row justify="space-between">
          <el-form-item label="SHAPE" prop="shape">
            <el-input v-model="form.shape" placeholder="请输入SHAPE" clearable></el-input>
          </el-form-item>
          <el-form-item label="GB" prop="gb">
            <el-input v-model="form.gb" placeholder="请输入GB" clearable></el-input>
          </el-form-item>
        </el-row>
        <el-row justify="space-between">
          <el-form-item label="ANGLE" prop="angle">
            <el-input v-model="form.angle" placeholder="请输入ANGLE" clearable></el-input>
          </el-form-item>
          <el-form-item label="FEAID" prop="feaid">
            <el-input v-model="form.feaid" placeholder="请输入FEAID" clearable></el-input>
          </el-form-item>
        </el-row>
        <el-row justify="space-between">
          <el-form-item label="DATE" prop="date">
            <el-input v-model="form.date" placeholder="请输入DATE" clearable></el-input>
          </el-form-item>
          <el-form-item label="STACOD" prop="stacod">
            <el-input v-model="form.stacod" placeholder="请输入STACOD" clearable></el-input>
          </el-form-item>
        </el-row>
        <el-row justify="space-between">
          <el-form-item label="VERS" prop="vers">
            <el-input v-model="form.vers" placeholder="请输入VERS" clearable></el-input>
          </el-form-item>
        </el-row>
      </el-form>
    </template>
  </el-drawer>
</template>
<script setup>
import useSpatialData from '@/hooks/useSpatialData'
const { route, addDrawer, drawerLoading, form, typeName, openDrawer, closeDrawer, confirmClick, isShowSave } = useSpatialData()
</script>
<style scoped></style>